<template>
  <div>
    <input type="text" v-if="isShowip" ref="inp" />
    <button @click="fn">搜索</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShowip: false,
    };
  },
  methods: {
    fn() {
      this.isShowip =  true;
      this.$nextTick(()=>{
        this.$refs.inp.focus()
      })
  },
}
}
</script>

<style>
</style>